package com.hailin.compress.impl;

import com.hailin.compress.Compress;
import com.hailin.compress.CompressContent;
import com.hailin.compress.annotation.SPI;
import org.xerial.snappy.Snappy;

import java.io.IOException;

/**
 * @Description   
 * @Author hailin
 * @Date 2018/6/22 11:19  
 * @Version 1.0
 */

@SPI(CompressContent.SNAPPY)
public class SnappyCompress implements Compress {

    @Override
    public byte[] compress(byte[] data) throws IOException {
        return Snappy.compress(data);
    }

    @Override
    public byte[] uncompress(byte[] data) throws IOException {
        return Snappy.uncompress(data);
    }
}
